//
//  NetworkTools.swift
//  SinaBlog
//
//  Created by ChenWei on 15/10/24.
//  Copyright © 2015年 cw. All rights reserved.
//

import UIKit
import AFNetworking

class NetworkTools: AFHTTPSessionManager {
    private static let tools: NetworkTools = {
        let url = NSURL(string: "https://api.weibo.com/")!
        let manager = NetworkTools(baseURL:url)

        // 设置AFN可以接收的数据类型
        manager.responseSerializer.acceptableContentTypes = NSSet(objects: "application/json", "text/json", "text/javascript", "text/plain") as Set<NSObject>
        
        return manager
    }()
    
    class func shareNetworkTools() -> NetworkTools {
        return tools
    }
}
